#ifndef __CONCRETEFACTORY_HPP__
#define __CONCRETEFACTORY_HPP__

#include "factory.hpp"
#include "concreteproduct1.hpp"
#include "concreteproduct2.hpp"

class ConcreteFactory:public Factory {
public:
	~ConcreteFactory() { cout<<__func__<<endl; }
	ConcreteFactory() { cout<<__func__<<endl; }
	virtual Product *createProduct();
};

inline Product *ConcreteFactory::createProduct()
{
	if (1 == _flag) {
		return new ConcreteProduct1();
	} else if (2 == _flag){
		return new ConcreteProduct2();
	} else {
		return NULL;
	}
}

#endif /* end of include guard */
